package sanliuzero;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main2 {

    private static int res = 0;

    public static void main(String[] args) throws Exception{
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
        String s = buf.readLine();
        String[] ss = s.split(" ");
        int n = Integer.parseInt(ss[0]);
        int m = Integer.parseInt(ss[1]);
        int x = Integer.parseInt(ss[2]);
        int k = Integer.parseInt(ss[3]);
        s = buf.readLine();
        ss = s.split(" ");
        int[] arr = new int[n];
        for (int i = 0; i < n; i++){
            arr[i] = Integer.parseInt(ss[i]);
        }
        backtrace(arr, n, m, x, k, 0);
        System.out.println(res);
    }

    public static void backtrace(int[] arr, int n, int m, int x, int k, int beginIndex){
        int minValue = Integer.MAX_VALUE;
        int minValue_index = 0;
        for (int i = 0; i < n; i++){
            if (arr[i] < minValue){
                minValue = arr[i];
                minValue_index = i;
            }
        }
        if (m == 0){
            if (minValue > res){
                res = minValue;
            }
            return;
        }
        int from = minValue_index - x >= 0? minValue_index - x : 0;
        int to = minValue_index + x < n? minValue_index + x : n - 1;
        for (int i = from; i <= to; i++){
            int[] tmp = arr.clone();
            int fromIndex = i - x >= 0? i - x : 0;
            int toIndex = i + x < n? i + x : n - 1;
            for (int j = fromIndex; j <= toIndex; j++){
                tmp[j] += k;
            }
            backtrace(tmp, n, m - 1, x, k, i);
        }
    }
}
